Configure providers per environment - #4548
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new feature that changes how provider settings work - from primary-environment-only to per-environment configuration. It includes a new UI component, new state management, and a behavioral change to instance deletion. New user-facing features warrant human review. You can customize Macroscope's approvability policy. Learn more. |
e46b174 to
53279a4
Compare
5ab8761 to
be176c3
Compare
What Changed
Why
Provider settings were implicitly tied to the primary server. In client-only mode, or when multiple T3 environments are connected, that made it impossible to see which machine owned an account configuration and could route updates to the wrong target.
UI Changes
Mobile-width verification
The real add-instance flow was exercised against the selected environment. The resulting provider instance was persisted to that environment and the confirmation toast named the target environment.
Checklist
vp checkvp test run src/components/settings/SettingsPanels.logic.test.ts src/hooks/useSettings.test.ts --project unit(13 tests)vp run typecheck— blocked by pre-existing@effect/vitestexport errors inoxlint-plugin-t3code; cleanorigin/mainfails with the same errorsNote
Medium Risk
Changes where provider accounts are read and written across environments, which could mis-route updates if selection logic is wrong; the reduced cleanup on delete/reset may leave orphaned model prefs or favorites for removed instances.
Overview
Provider settings are no longer tied to the primary server only. The Providers panel adds an environment selector so reads, edits, refreshes, and one-click provider updates target the chosen connected environment, with loading and “no environments” empty states.
resolveProviderSettingsEnvironmentIdpicks the effective environment: explicit selection, then primary (managed), then active/first available (client-only), with fallback when a stale selection disappears.AddProviderInstanceDialognow requiresenvironmentId/environmentLabeland persists new instances via per-environment settings; success copy names the environment.Deleting a custom instance or resetting a default provider only updates
providerInstances(and legacyproviderson reset)—it no longer stripsproviderModelPreferencesorfavoritesin the same patch.Reviewed by Cursor Bugbot for commit be176c3. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scope provider settings and instance management to a selected environment
ProviderSettingsEnvironmentPanelcomponent in SettingsPanels.tsx, replacing the previous primary-settings-only approach.ProviderEnvironmentSelectorcomponent in ProviderEnvironmentSelector.tsx lets users switch the active environment for provider configuration.resolveProviderSettingsEnvironmentIdin SettingsPanels.logic.ts, which handles fallback to primary or active environment when no explicit selection exists.AddProviderInstanceDialognow acceptsenvironmentIdandenvironmentLabelprops and stores new instances against the selected environment.Macroscope summarized be176c3.